<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>登录注册切换测试01</title>
    <style>
        * {
            padding: 0;
            margin: 0;
            transition: 0.3s;
        }

        body {
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            background-image: url(images/bj-1.png);
            background-size: cover;
        }

        .q-link {
            position: relative;
            color: hsl(0, 5%, 87%);
            float: right;
            top: 30px;
            text-decoration: none;
        }

        .shell {
            width: 350px;
            padding: 40px;
            display: flex;
            align-items: center;
            flex-direction: column;
            background-color: #ffffff49;
            border-radius: 50px;
            box-shadow: 0 0 30px rgba(255, 255, 255, 0.5) inset;
            transform: translateY(-50px);
        }

        .title {
            font-size: 80px;
            margin-bottom: 30px;
            color: #fff;
            text-shadow: 0 0 10px #ff9dff80;
        }

        input[type="text"],
        input[type="password"] {
            width: 100%;
            height: 50px;
            margin: 10px 0;
            box-sizing: border-box;
            color: rgb(0, 0, 0);
            border: 5px solid transparent;
            background: rgba(255, 255, 255, 0.5);
            border-radius: 100px;
            padding: 5px 20px 0 20px;
            transition: 0.3s;
            font-size: 18px;
            outline: none;
        }

        input[type="text"]:hover,
        input[type="password"]:hover {
            background: rgba(255, 255, 255, 0);
            border: 5px solid #ffffff;
        }

        input[type="submit"] {
            width: 100%;
            height: 50px;
            padding: 10px;
            margin: 15px 0;
            border-radius: 100px;
            border: none;
            background-color: #6ba0d8;
            color: #fff;
            cursor: pointer;
            font-size: 20px;
            letter-spacing: 3px;
        }

        input::placeholder {
            color: #92a7e8;
        }

        .footer {
            display: flex;
            justify-content: space-between;
            align-items: center;
            width: 100%;
            margin-top: 20px;
        }

        .Remember {
            opacity: 1;
            display: flex;
            justify-content: center;
            align-items: center;
            font-size: 18px;
            color: #7597ff;
        }

        input[type="checkbox"] {
            display: block;
            width: 25px;
            height: 25px;
            margin-right: 10px;
            background-color: #007bff;
        }

        #Password {
            border: none;
            background-color: #ffffff00;
            color: #7597ff;
            font-size: 18px;
        }
    </style>
</head>

<body>
    <div class="shell">
        <h2 class="title">登录</h2>
        <input type="text" id="username" placeholder="用户名" />
        <input type="password" id="password" placeholder="密码" />
        <input type="submit" value="登录" id="loginBtn" />
        <div class="footer">
            <div class="Remember">
                <input type="checkbox" id="rememberMe" />
                <label for="rememberMe">记住我</label>
            </div>
            <button id="Password">去注册</button>
        </div>
        <a href="https://wj-dongjian.jd.com/q/61a05143f2ec2b00b35e40a6" target="_blank"
            clstag="pageclick|keycount|passport_main|click_inves_qusetion" class="q-link"
            style="outline: rgb(109, 109, 109) none 0px;"><b></b>登录页面，改进建议</a>
    </div>

</body>

<script>
    document.getElementById("Password").addEventListener("click", function () {
        var title = document.querySelector(".title");
        var loginBtn = document.getElementById("loginBtn");
        var rememberMeLabel = document.querySelector(".Remember");
        var passwordBtn = document.getElementById("Password");
        if (title.innerText === "登录") {
            title.innerText = "注册";
            loginBtn.value = "注册";
            rememberMeLabel.style.opacity = "0";
            passwordBtn.innerText = "去登录";
            document.getElementById("username").value = "";
            document.getElementById("password").value = "";
            document.getElementById("username").placeholder = "用户名";
            document.getElementById("password").placeholder = "密码";
            document.getElementById("password").type = "password";
        } else {
            title.innerText = "登录";
            loginBtn.value = "登录";
            rememberMeLabel.style.opacity = "1";
            passwordBtn.innerText = "去注册";
            document.getElementById("username").placeholder = "用户名";
            document.getElementById("password").placeholder = "密码";
            document.getElementById("password").type = "password";
        }
    });
</script>

</html>